package com.esixnetwork.apollo.common.exception;


import com.esixnetwork.apollo.common.head.ResultCode;

/**
 * 通用异常
 */
public class ApolloException extends RuntimeException{

  //错误代码
    private String code;

    public ApolloException() {
    }

    public ApolloException(String code) {
    this.code = code;
  }

    public ApolloException(String code, String message) {
        super(message);
        this.code = code;
    }

    public ApolloException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public ApolloException(Throwable cause, String code) {
        super(cause);
        this.code = code;
    }

    public ApolloException(Throwable cause) {
        super(cause);
    }

    public ApolloException(ResultCode resultCode){
        super(resultCode.getDesc());
        this.code = resultCode.getCode();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

}
